Skip to content

Add diagnosticReporter config option#1701

Merged
TwitchBronBron merged 6 commits intomasterfrom
feature/diagnostic-reporters
May 7, 2026
Merged

Add diagnosticReporter config option#1701
TwitchBronBron merged 6 commits intomasterfrom
feature/diagnostic-reporters

Conversation

@chrisdp
Copy link
Copy Markdown
Contributor

@chrisdp chrisdp commented May 6, 2026

Summary

  • New diagnosticReporter setting (and --diagnostic-reporter CLI flag) selecting how diagnostics are rendered: "detailed" (default), "github-actions", or a custom {file}:{line}: {message} template
  • Accepts an array so multiple reporters run per build (e.g. detailed terminal output + GitHub Actions PR annotations from the same CI run, no third-party tool needed)
  • Invalid values are warned about and skipped; all-invalid falls back to "detailed" (never aborts the build)

chrisdp added 2 commits May 6, 2026 10:22
Adds a new `diagnosticReporter` setting in bsconfig.json (and a matching
`--diagnostic-reporter` CLI flag) that lets users pick how diagnostics are
rendered to the console. Accepts a single value or an array, where each
value is a preset name ("detailed", "github-actions"), a custom template
string, or an explicit object form. Multiple reporters can run in the same
build so a CI run can emit detailed terminal output and GitHub Actions PR
annotations simultaneously without a third-party tool.

Invalid reporter values are logged and skipped rather than aborting the
build; if every configured reporter is invalid the build falls back to
"detailed". Schema and docs/bsconfig.md updated.
Comment thread src/BsConfig.ts Outdated
Comment thread src/ProgramBuilder.ts
Comment thread src/BsConfig.ts Outdated
Copilot finished work on behalf of chrisdp May 7, 2026 15:49
Comment thread bsconfig.schema.json Outdated
"error"
]
},
"diagnosticReporter": {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot missed a rename here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c188846 — schema key is now diagnosticReporters.

Comment thread src/ProgramBuilder.ts Outdated
//the resolved function is stashed on the entry as `run` so we don't have to keep a parallel array.
//invalid entries are warned about and skipped (we never want to abort a build over a config typo).
const reporters = diagnosticUtils.normalizeDiagnosticReporters(
this.options?.diagnosticReporters ?? this.options?.diagnosticReporter,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we should only have the option of diagnosticReporters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e881d84 — singular support was removed so only diagnosticReporters is accepted (including CLI/docs/runtime resolution).

Copilot finished work on behalf of chrisdp May 7, 2026 17:49
@TwitchBronBron TwitchBronBron enabled auto-merge (squash) May 7, 2026 17:56
@TwitchBronBron TwitchBronBron merged commit ca8681c into master May 7, 2026
7 checks passed
@TwitchBronBron TwitchBronBron deleted the feature/diagnostic-reporters branch May 7, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants